<?php
namespace App\Libs\Commons;
class MyException extends \Exception {
	public function __construct($code, $message="", $data=array()){
		$this->code = $code;
		$this->message = $message ? : MyMessage::getMessage($code);
		$log_data = [
			'code'			=> $this->code,
			'position'		=> $this->file . ':' .$this->line,
			'origin_data' 	=> $data
		];
		MyLogger::log(MyLogger::ERROR, $this->message, $log_data);
	}
}